<template>
  <div>我是D组件 {{ msg }}</div>
</template>

<script>
import Bus from "../utils/EventBus";
export default {
  created() {
    Bus.$on("sendMsg", msg => {
      this.msg = msg;
    });
  },
  data() {
    return {
      msg: ""
    };
  }
};
</script>

<style scoped>
div {
  width: 100px;
  height: 30px;
  background-color: skyblue;
  border: 1px solid red;
}
</style>